package pl.slyplan.entity;

import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

public enum QueuePriority {
	VERBOSE,
	LOW,
	MEDIUM,
	HIGH,
	VIP,
	;
	
	private static List<QueuePriority> priorities;
	static {
		LinkedList<QueuePriority> tmpPriority = new LinkedList<>();
		tmpPriority.add(VERBOSE);
		tmpPriority.add(LOW);
		tmpPriority.add(MEDIUM);
		tmpPriority.add(HIGH);
		tmpPriority.add(VIP);
		
		priorities = new ArrayList<>(tmpPriority);
	}
	
	public int getPriority() {
		int priority = priorities.indexOf(this);
		// jeśli nie zdefiniowano priorytetu to potraktuj go tj. MEDIUM
		if(priority==-1) {
			return priorities.indexOf(MEDIUM);
		}
		return priority;
	}
}
